//package com.example.userservice.shopservices;
//
//import static lambdasinaction.chap11.Util.delay;
//import static lambdasinaction.chap11.Util.format;
//
//import java.util.Random;
//
//// https://blog.csdn.net/qq_26676207/article/details/80405497
//// values
//// valueOf[]
//
//public class Shop {
//
//    private final String name;
//    private final Random random;
//
//    public Shop(String name) {
//        this.name = name;
//        random = new Random(name.charAt(0) * name.charAt(1) * name.charAt(2));
//    }
//
//    //模拟延迟
//    public String getPrice(String product) {
//        double price = calculatePrice(product);
//        //values
//        //values().length enum 的vaules
//        //Discount.Code code = Discount.Code.values()[random.nextInt(Discount.Code.values().length)];
//        return name + ":" + price + ":" + code;
//    }
//
//    public double calculatePrice(String product) {
//        delay();
//        return format(random.nextDouble() * product.charAt(0) + product.charAt(1));
//    }
//
//    public String getName() {
//        return name;
//    }
//}
